import { request } from '../../../../config/request'
import config from '../../../../config/config'

// 查询用户详情
export async function getDetail(params) {
	return request({
		url: `${config.sysApiHeader}/v1/pearlriver/comm/user/detail/get`,
		method: 'GET',
		data: params
	});
};

// 新增用户
export async function addUser(params) {
	return request({
		url: `${config.sysApiHeader}/v1/pearlriver/comm/user/save`,
		method: 'PUT',
		headers: {
			"Content-type": "application/json"
		},
		data: params
	});
};

// 编辑用户
export async function editUser(params) {
	return request({
		url: `${config.sysApiHeader}/v1/pearlriver/comm/user/save`,
		method: 'PUT',
		headers: {
			"Content-type": "application/json"
		},
		data: params
	});
};

// 系统的角色管理员树
export async function getRoleTree(params) {
	return request({
		url: `${config.sysApiHeader}/v1/pearlriver/comm/user/role/list`,
		method: 'GET',
		data: params
	});
};

// 组织管理员列表
export async function getOrganize(params) {
	return request({
		url: `${config.sysApiHeader}/v1/pearlriver/comm/role/org/get`,
		method: 'GET',
		data: params
	});
};

// 重置用户密码
export async function resetPwd(params) {
	return request({
		url: `${config.sysApiHeader}/v1/pearlriver/user/resetPwd`,
		method: 'POST',
		data: params
	});
};

// 职能列表
export async function getDuty(params) {
	return request({
		url: `${config.sysApiHeader}/v1/pearlriver/comm/user/duty/list`,
		method: 'GET',
		data: params
	});
};